package com.zyz.M_File和IO流.IO流.对象流;

import java.io.Serializable;

/**
 * @author: vick
 * @Date: 2025/4/10
 * @Description:
 * @version: 1.0
 */
//对象 ===》 二进制文件  （序列化）
// 二进制文件 ==》 对象 （反序列化）
public class Person implements Serializable {
    private static final long serialVersionUID = 1424915336563327876L;
    //static修饰的静态变量，不会被序列化
    public static String company;
    public String name;
    public String address;
    //transient 修饰的 瞬态成员，不会被序列化
    public transient int age;

    public Person() {
    }

    public Person(String name, String address, int age) {
        this.name = name;
        this.address = address;
        this.age = age;
    }

    public static String getCompany() {
        return company;
    }

    public static void setCompany(String company) {
        Person.company = company;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", address='" + address + '\'' +
                ", age=" + age +
                '}';
    }
}
